@extends('layouts.page')
@section('title', $act->subject)
@section('content')
    <div id="tf-contact">
        <div class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <h3 class="text-center">{{$act->subject}}</h3>
                    <br/>

                    <p class="text-center">
                        <a class="btn btn-warning" href="/activity/{{$act->id}}/register">我要报名</a>
                    </p>

                    <p><span class="label label-info">活动时间</span></p>
                    <hr/>
                    <p>
                        {{ date('m月d日 H:i', strtotime($act->start_time)) }}
                        ~ {{ date('m月d日 H:i', strtotime($act->end_time)) }}
                    </p>

                    <br/><br/>
                    <p><span class="label label-info">详细介绍</span></p>
                    <hr/>

                    <div class="">{!! $act->details !!}</div>

                    <br/><br/>
                    <p><span class="label label-info">报名统计</span></p>
                    <hr/>


                    <small>已有{{$act->max_no - $act->remaining_no}}人参加，还有{{$act->remaining_no}}个名额</small>
                    <small><a href="/activity/{{$act->id}}/register">我也要参加</a></small>
                    <br/><br/>


                    <table class="table">
                        <thead>
                        <tr>
                            <th>姓名</th>
                            <th>手机</th>
                            <th>报名时间</th>
                        </tr>
                        </thead>

                        @foreach($regs as $reg)
                            <tr>
                                <td>{{$reg->user->name}}</td>
                                <td>{{$reg->user->mobile}}</td>
                                <td>{{$reg->created_at}}</td>
                            </tr>
                        @endforeach

                    </table>

                </div>
            </div>
        </div>
    </div>

@endsection